<html>
<head><meta charset="utf-8"><title>streaming build.rs output with x.py · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/streaming.20build.2Ers.20output.20with.20x.2Epy.html">streaming build.rs output with x.py</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="198052537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/streaming%20build.rs%20output%20with%20x.py/near/198052537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Hughes <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/streaming.20build.2Ers.20output.20with.20x.2Epy.html#198052537">(May 19 2020 at 11:39)</a>:</h4>
<p>How do I stream build script output with x.py? I've added a couple of commands to <code>src/libstd/build.rs</code> which I need to debug but the output doesn't seem to appear if I run <code>./x.py build src/libstd -vv</code>. Any ideas what I'm missing?</p>



<a name="198052731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/streaming%20build.rs%20output%20with%20x.py/near/198052731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Hughes <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/streaming.20build.2Ers.20output.20with.20x.2Epy.html#198052731">(May 19 2020 at 11:41)</a>:</h4>
<p>sorry... just noticed i should have posted this under t-compiler/help. Can't work out how to move it though <span aria-label="sweat" class="emoji emoji-1f613" role="img" title="sweat">:sweat:</span></p>



<a name="198055853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/streaming%20build.rs%20output%20with%20x.py/near/198055853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Notification Bot <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/streaming.20build.2Ers.20output.20with.20x.2Epy.html#198055853">(May 19 2020 at 12:14)</a>:</h4>
<p>This topic was moved here from <a class="stream-topic" data-stream-id="131828" href="/#narrow/stream/131828-t-compiler/topic/streaming.20build.2Ers.20output.20with.20x.2Epy">#t-compiler &gt; streaming build.rs output with x.py</a> by <span class="user-mention silent" data-user-id="116122">simulacrum</span></p>



<a name="198055873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/streaming%20build.rs%20output%20with%20x.py/near/198055873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/streaming.20build.2Ers.20output.20with.20x.2Epy.html#198055873">(May 19 2020 at 12:14)</a>:</h4>
<p>moved :)</p>



<a name="198055891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/streaming%20build.rs%20output%20with%20x.py/near/198055891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/streaming.20build.2Ers.20output.20with.20x.2Epy.html#198055891">(May 19 2020 at 12:14)</a>:</h4>
<p>hm is the build script being run?</p>



<a name="198055899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/streaming%20build.rs%20output%20with%20x.py/near/198055899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/streaming.20build.2Ers.20output.20with.20x.2Epy.html#198055899">(May 19 2020 at 12:14)</a>:</h4>
<p>(is it failing?)</p>



<a name="198060787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/streaming%20build.rs%20output%20with%20x.py/near/198060787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Hughes <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/streaming.20build.2Ers.20output.20with.20x.2Epy.html#198060787">(May 19 2020 at 12:55)</a>:</h4>
<p>The build script is being run yes. It's not failing but I believe it's calling the linker with subtly wrong flags. If I chuck a panic in there I can inspect the output. Unfortunately, because of some non-determinism in my build script things seem to be going wrong at stage-1 (stage-0 builds fine). It would be very helpful to stream its output though</p>



<a name="198060919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/streaming%20build.rs%20output%20with%20x.py/near/198060919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Hughes <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/streaming.20build.2Ers.20output.20with.20x.2Epy.html#198060919">(May 19 2020 at 12:56)</a>:</h4>
<p>Right now I'm doing some very shameful hacking with files to be able to abort the build at stage1 just to see what it's doing :)</p>



<a name="198061037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/streaming%20build.rs%20output%20with%20x.py/near/198061037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/streaming.20build.2Ers.20output.20with.20x.2Epy.html#198061037">(May 19 2020 at 12:57)</a>:</h4>
<p>hm I think cargo won't show non-failed build script output, but maybe try <code>-vvv</code>? We definitely pass verbosity to cargo only at some higher level of x.py verbosity</p>



<a name="198063695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/streaming%20build.rs%20output%20with%20x.py/near/198063695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Hughes <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/streaming.20build.2Ers.20output.20with.20x.2Epy.html#198063695">(May 19 2020 at 13:17)</a>:</h4>
<p>Aha, I was missing a <code>v</code>.  Thanks <span class="user-mention" data-user-id="116122">@simulacrum</span> , lifesaver!</p>



<a name="198075521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/streaming%20build.rs%20output%20with%20x.py/near/198075521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/streaming.20build.2Ers.20output.20with.20x.2Epy.html#198075521">(May 19 2020 at 14:40)</a>:</h4>
<p>You can also inspect build script output in the build directory after-the-fact. The path is something like <code>rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/build/std-1c20e82b0fffcf3b/output</code> replacing the target, stage, and hash in the directory name depending on what you are building.</p>



<a name="198080190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/streaming%20build.rs%20output%20with%20x.py/near/198080190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Hughes <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/streaming.20build.2Ers.20output.20with.20x.2Epy.html#198080190">(May 19 2020 at 15:09)</a>:</h4>
<p>I did try using <code>find</code> in the build directory to try and find remnants of the build script output to no avail, <span class="user-mention" data-user-id="120518">@Eric Huss</span>  is this also true when you compile without the verbose flags? (It's likely I was simply grepping for the wrong things)</p>



<a name="198207709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/streaming%20build.rs%20output%20with%20x.py/near/198207709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/streaming.20build.2Ers.20output.20with.20x.2Epy.html#198207709">(May 20 2020 at 14:37)</a>:</h4>
<p>The output is always saved.  I forgot to mention that stderr is saved separately in a <code>stderr</code> file.</p>



<a name="198207856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/streaming%20build.rs%20output%20with%20x.py/near/198207856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/streaming.20build.2Ers.20output.20with.20x.2Epy.html#198207856">(May 20 2020 at 14:38)</a>:</h4>
<p>Er, I should say it is always saved if the scripts succeeds.  On failure the output is displayed on the console.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>